{{ if and (eq .Values.controlPlane.mode "global") .Values.controlPlane.tls.kdsGlobalServer.create }}
apiVersion: v1
kind: Secret
metadata:
{{ with .Values.controlPlane.tls.kdsGlobalServer.secretName }}
  name: {{ . }}
{{ else }}
  name: {{ include "kuma.name" . }}-kds-global-server-tls
{{ end }}
  labels: {{ include "kuma.cpLabels" . | nindent 4 }}
type: kubernetes.io/tls
stringData:
  tls.crt: {{ required "you must provide a kds tls cert" .Values.controlPlane.tls.kdsGlobalServer.cert | quote }}
  tls.key: {{ required "you must provide a kds tls key" .Values.controlPlane.tls.kdsGlobalServer.key | quote }}
{{ end }}
